package com.lucan.tracking.api.executor;

/**
 * @author qihailong
 * @date 2018/7/26 上午10:45
 * @description TODO
 */

public class RunnablePriority implements Runnable, Comparable<RunnablePriority> {

    private int priority;

    public RunnablePriority(int priority) {
        this.priority = priority;
    }

    @Override
    public int compareTo(RunnablePriority o) {
        return o.getPriority() - this.getPriority();
    }

    @Override
    public void run() {
        hook();
    }

    public void hook() {

    }

    private int getPriority() {
        return priority;
    }
}
